package com.lanyou.esb.cook.proxy.meta;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * 接口状态 <br>
 * 描述：<br>
 * 0：停用；1：启用
 * 
 * @author Davey.wu
 */
public enum IfStatus {
	DISABLE("0"), ENABLE("1");

	public final String ValueCode;

	private IfStatus(String code) {
		this.ValueCode = code;
	}

	public static IfStatus get(String valueCode) throws NoSuchObjectException {
		if (StringUtils.isBlank(valueCode)) {
			throw new NullPointerException();
		}
		for (IfStatus type : IfStatus.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
